const jwt = require('jsonwebtoken');
const secret = 'SLDLKKDS323ssdd@#@@gf';
module.exports = class extends think.Service {
  sign(data) {
    return jwt.sign(data, secret);
  }
  unsign(token) {
    try {
      return jwt.verify(token, secret);
    } catch (e) {
      return null;
    }
  }
};
